import React from 'react';
import { Link } from 'react-router-dom'
import {Button} from "antd";
function Layout({ children, history }) {
  const goTargetPage = (url) => {
    history.push(url)
  }
  return (
    <div>
      <h1>全局基础模版</h1>
      <Link to="/dashboard">跳转到图表界面</Link>
      <Button type="primary" onClick={() => goTargetPage('/user/123')}>使用点击事件 + historyapi的形式跳转到user页面</Button>
      <Button type="dashed" onClick={() => goTargetPage('/')}>使用点击事件 + historyapi的形式跳转到首页面</Button>
      <hr/>
      {children}
    </div>
  );
}

export default Layout;
